package org.testmyapp.entities;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.testmyapp.persistence.BusinessObjectMarker;

@Entity
@IdClass(RetentionPk.class)
public class Retention extends AbsEntity implements BusinessObjectMarker {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7010016187703207211L;
	
	public static String tableName = "Retention";
	
	@Id
	@ManyToOne
	@JoinTable(name = "tariffInstance_fk", joinColumns = {
			@JoinColumn(name = "rt_ip_fk", referencedColumnName = "ip_fk"),
			@JoinColumn(name = "rt_tarif_fk", referencedColumnName = "tarif_fk") })
	private TariffInstance tariffInstance;
	@Id
	@ManyToOne
	@JoinTable(name = "coverage_fk", joinColumns = {
			@JoinColumn(name = "rt_tarif_def_fk", referencedColumnName = "tarif_def_fk"),
			@JoinColumn(name = "rt_claim_type_fk", referencedColumnName = "claim_type_fk") })
	private Coverage coverage;
	@Temporal(value = TemporalType.DATE)
	private Date periodLeft;
	@Temporal(value = TemporalType.DATE)
	private Date periodRight;
	private int retentionState;
	
	public TariffInstance getTariffInstance() {
		return tariffInstance;
	}
	public void setTariffInstance(TariffInstance tariffInstance) {
		this.tariffInstance = tariffInstance;
	}
	public Coverage getCoverage() {
		return coverage;
	}
	public void setCoverage(Coverage coverage) {
		this.coverage = coverage;
	}
	public Date getPeriodLeft() {
		return periodLeft;
	}
	public void setPeriodLeft(Date periodLeft) {
		this.periodLeft = periodLeft;
	}
	public Date getPeriodRight() {
		return periodRight;
	}
	public void setPeriodRight(Date periodRight) {
		this.periodRight = periodRight;
	}
	public int getRetentionState() {
		return retentionState;
	}
	public void setRetentionState(int retentionState) {
		this.retentionState = retentionState;
	}

}
